UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jHZkr9mO9VQi4oopm+qidMtmh4ZtH6e+OY7JC1zMOjI='
WHERE
key_id = 'c39d2884540d6bdd638afda54fde3d4042a8935dfb43a035c47fc66cf82048a7'
AND (
token = 'jHZkr9mO9VQi4oopm+qidMtmh4ZtH6e+OY7JC1zMOjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)