UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mq03KrOtqFf40DbYQ0ein5yDnikpzRIjFG50vhKzE0o='
WHERE
key_id = '76f6f8a00f185c2c66a2138355fdb45750b47fe2fcba604159911fb438f50ce0'
AND (
token = 'Mq03KrOtqFf40DbYQ0ein5yDnikpzRIjFG50vhKzE0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)