UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ie5XOAKmw5kRRsTCVzas/B3uTQkPTqX8YaGdpW1xd9k='
WHERE
key_id = '28054aff74dcd9868bf46619d879af04578eedbb311b533e92b9f54e81761fcc'
AND (
token = 'Ie5XOAKmw5kRRsTCVzas/B3uTQkPTqX8YaGdpW1xd9k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)