UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+vV3XrhMMCw+pjHs1m4JeHWBNHOarKg12dFc8tul8r8=' 
WHERE 
  key_id = 'f9ace48cf86a9d145b0a8a9255e4595b172d943dc1e2eedef9a4c7deb5890d88' 
  AND (
    token = '+vV3XrhMMCw+pjHs1m4JeHWBNHOarKg12dFc8tul8r8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036