UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVI7ya/nYr6BEXDbQdApZEHEFhY9EXBIU2Mbi2ytDXU=' 
WHERE 
  key_id = 'd8ee56d6a60a2619584655abc54611d96e95b86a38fdfbed3b9cd5ceb124ca12' 
  AND (
    token = 'LVI7ya/nYr6BEXDbQdApZEHEFhY9EXBIU2Mbi2ytDXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035