UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/x7ABMijbkMXn5Z0yEJ8PQ2dIJDatjnyiGZLxnqilU=' 
WHERE 
  key_id = '53bae5efdd899f09ce759400546f06e248673be04eeecb3ea3aab2744801af90' 
  AND (
    token = 'j/x7ABMijbkMXn5Z0yEJ8PQ2dIJDatjnyiGZLxnqilU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031