UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KhmdxAD3dSeI3R4xeolMOnwUXVAk7c0afZbckztX7iE=' 
WHERE 
  key_id = 'ac4080566a2a86ba357c475b902affe692f8866f5036c028654462d5f945f200' 
  AND (
    token = 'KhmdxAD3dSeI3R4xeolMOnwUXVAk7c0afZbckztX7iE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015