UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1jLmvdbILHZEGEZNvsyC/0+sXiSkz/z0PJOncxbGOQE='
WHERE
key_id = 'bf9c2f6577dbacc2d2b4ea0fbd6ffd2214d0e36cb80f0d39c66025eab7385a2f'
AND (
token = '1jLmvdbILHZEGEZNvsyC/0+sXiSkz/z0PJOncxbGOQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)