UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UVhjrGucGuIBkrub2nv5pt6Yl802FP8UvQ3rl8ifrMw='
WHERE
key_id = 'b60b48456154cc443bbc71b5928de617eaedf309defa804880e5a6a901eeaf2e'
AND (
token = 'UVhjrGucGuIBkrub2nv5pt6Yl802FP8UvQ3rl8ifrMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)