UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F3BSNeHQdjIa8sG4iOx+StyDx4h5nVegUOMJ33n4fwk='
WHERE
key_id = '6007a4a0fe6152896abec54a0f00db3a077a0a6c9f124876297aea15e599c879'
AND (
token = 'F3BSNeHQdjIa8sG4iOx+StyDx4h5nVegUOMJ33n4fwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)