UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6Qzx52Q9n8Bcj/KrKKDH7z3r1w9XenJNAELKBUORkI='
WHERE
key_id = 'd5512185386266e001e17cb2164b33c246dee71ec2970b12bd6b821f79a5cefb'
AND (
token = 'Z6Qzx52Q9n8Bcj/KrKKDH7z3r1w9XenJNAELKBUORkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)