UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iuCINwIb4AKeHgJDtTth/mmylKK8uheIff5G93FzWVM='
WHERE
key_id = '8c955578fae3872cd04c6d13b6268570e423a1a90dbc67fd6f44713170803462'
AND (
token = 'iuCINwIb4AKeHgJDtTth/mmylKK8uheIff5G93FzWVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)