UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8SWn73ncQoGQDX/TOOr9b6xvb67b0MfzOnGbpEugL0g='
WHERE
key_id = 'd6c57e68ba29d9358f4c21a21354de2809b6dc7c1ccdb42abbeb4e598ee3c8ff'
AND (
token = '8SWn73ncQoGQDX/TOOr9b6xvb67b0MfzOnGbpEugL0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)