UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0R2abuQu5/XZwKcs7CU0tTAowRgl4SDziMsF7DE/mpM='
WHERE
key_id = '52f400cc8616510743d0979121c9aa1c7a9d1143c0b3d31a83bad19f74a2feec'
AND (
token = '0R2abuQu5/XZwKcs7CU0tTAowRgl4SDziMsF7DE/mpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)