UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1XIK0DIYkAyivYHu3NSp5fJFAohK0h/N2IXVG0pYcCw='
WHERE
key_id = 'f25db295a9d4d41a731c84acf3a760516f4a159b4974979ab91fbd1b14c1e578'
AND (
token = '1XIK0DIYkAyivYHu3NSp5fJFAohK0h/N2IXVG0pYcCw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)