UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNYLQmQy24yVHo6hxKebG39u0OZtNerU5W4COYUmNCA='
WHERE
key_id = '89409699ece46de8b0cbcfc3a5869ddc9886d8299295bfa0e961c243a7037ff7'
AND (
token = 'JNYLQmQy24yVHo6hxKebG39u0OZtNerU5W4COYUmNCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)