UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MW29hZaVHYlPLLSkBa3XPvPVQUuKIgk8d3aXHpAq9Mc='
WHERE
key_id = '343ee16455897bbde85977894e32ed8e7bbbc8ed1846dbdb9af41e42ff650019'
AND (
token = 'MW29hZaVHYlPLLSkBa3XPvPVQUuKIgk8d3aXHpAq9Mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)