UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aaNU/xoTvTMWyf8TSVJ8Aws2aiagRMI4uRm4Jtb7r8o=' 
WHERE 
  key_id = 'de2dbb0104fb5c9fa263087ada42102124d111a29e9b5f1f17cd06d17a36c9a3' 
  AND (
    token = 'aaNU/xoTvTMWyf8TSVJ8Aws2aiagRMI4uRm4Jtb7r8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017