UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XVFF4fWcFUQqQfvdtR4HZbKD4w/InaImvj0736vMk54='
WHERE
key_id = '23a4a21e12bd8375ace9c1289e1f2d06e98794c19a79ed555e6fde8d8c0936e7'
AND (
token = 'XVFF4fWcFUQqQfvdtR4HZbKD4w/InaImvj0736vMk54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)