UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oqX7965/CLYiWFuAu+D+4Rz1uYXx3FWiJex9D98Y7dY=' 
WHERE 
  key_id = '89627435436025069da83e5ede58cdfcccd46a24a9fa946ffbb9412a5f8c8821' 
  AND (
    token = 'oqX7965/CLYiWFuAu+D+4Rz1uYXx3FWiJex9D98Y7dY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030