UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wSze42jZboYdAVt9GpjdG7WpyxhsXUAPQki1CaSCRs='
WHERE
key_id = '5522feb0c40a92e62cf42c142b97b8bde96f6ca42c8ba3dcece1ad7f87f6d60e'
AND (
token = '/wSze42jZboYdAVt9GpjdG7WpyxhsXUAPQki1CaSCRs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)