UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VDcGHaXAbSQCPdZIjFFZFhQp+K6/4L/yAJevdnW0Ynw=' 
WHERE 
  key_id = '86d3c9ece46f54271a6b637762d6c4226a0f73da190121936148cd378a571966' 
  AND (
    token = 'VDcGHaXAbSQCPdZIjFFZFhQp+K6/4L/yAJevdnW0Ynw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035