UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm04G93bp4QWvp27NRN2YStVN+3wje+ITVcp+Gp59uWE='
WHERE
key_id = '21b36a21a6454cd54e95ff0c6df4df85a46174ba70dc3fc3c804b62407f535ec'
AND (
token = 'm04G93bp4QWvp27NRN2YStVN+3wje+ITVcp+Gp59uWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)