UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'je/uiwchzJJBn2FqAvh+zC+k01dYmSW9yRmldOm8hL8='
WHERE
key_id = '499a2ff32ac5aad8873d737f8620277af90347fbf0b1dcb3992310e075b8cb31'
AND (
token = 'je/uiwchzJJBn2FqAvh+zC+k01dYmSW9yRmldOm8hL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)