UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RDBhmlI1VviUMbsbSoSDQTa2SB1MPQxUScmAUFY0sH0=' 
WHERE 
  key_id = '0863d9f2f8dbfd625ca57d5be0ba07a7efc8dbf9f8517cbd96a57f18b1e1b8e2' 
  AND (
    token = 'RDBhmlI1VviUMbsbSoSDQTa2SB1MPQxUScmAUFY0sH0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034