UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '79BCk22eQk4seaYpNhmdS5q/gK7yjHqUfgmuCfBT35w='
WHERE
key_id = '8a95a6c79864213bba973895ee2737e71ba735e458799f8a7cb9be761dba7a4a'
AND (
token = '79BCk22eQk4seaYpNhmdS5q/gK7yjHqUfgmuCfBT35w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)