UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/V9HebCc9T4y2J10JKd0xsbRaM3n+VXJSDohB/APqzE='
WHERE
key_id = 'b6c99c95000228cdb14a10f839992eaa0200f4c27065adb4cb3257cdc7842b6c'
AND (
token = '/V9HebCc9T4y2J10JKd0xsbRaM3n+VXJSDohB/APqzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)