UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W6j8Id6jkYUdjLh87SeK/ykQ2G24pNw9DK1pyjocq7k='
WHERE
key_id = '1c16db288c70305740cb7361512f25fb99c12fc2678f405d8a29006254e5d204'
AND (
token = 'W6j8Id6jkYUdjLh87SeK/ykQ2G24pNw9DK1pyjocq7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)