UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+M7dBOXGF9ZZmiQs3SLAmLxP/drEQMFurfmilCzn83w=' 
WHERE 
  key_id = 'e2630d3dbaa4e472ea0e44a8ee5eb5475f75ac4b51a32a089717be433b1a6cb1' 
  AND (
    token = '+M7dBOXGF9ZZmiQs3SLAmLxP/drEQMFurfmilCzn83w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030