UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aMFJ7r34QGndi+IVDJTmh35qv6Dn88sbCvCUM5nQJvs=' 
WHERE 
  key_id = '6cd2d0f275c3cacad4efaa77cd69d60c2370fdd4b6ca60c4b7c33fc2431ab7dc' 
  AND (
    token = 'aMFJ7r34QGndi+IVDJTmh35qv6Dn88sbCvCUM5nQJvs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050