UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GOpBVJ8GgAcOcYZTl/DZXFZzNU9P0jgs91G4GX4npW0=' 
WHERE 
  key_id = '73baa037a578122bccff7e5c821e52942049bb0b636b6192abf6c0a84ab52651' 
  AND (
    token = 'GOpBVJ8GgAcOcYZTl/DZXFZzNU9P0jgs91G4GX4npW0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033