UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BtxiSKgyk+hv9pwtH55IozMEXJGnGWrc7p6w4XeOXUk='
WHERE
key_id = '85e327ae6f9a1a23259f1855853be4957b7b6f718b82e75bfbcf0178a1f04cc1'
AND (
token = 'BtxiSKgyk+hv9pwtH55IozMEXJGnGWrc7p6w4XeOXUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)