UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M0zPihA9AGS89riCKeGtTfYH+KVqq9JWuwUyNjoYr58='
WHERE
key_id = 'c1994af593c056b14da4b4fa90bd77c280380529d4e84325e65c79fb8e5b23fa'
AND (
token = 'M0zPihA9AGS89riCKeGtTfYH+KVqq9JWuwUyNjoYr58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)