UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oHTsnQ1cVWz4842k9fNJ9Tj2CmP7hsHKWaQiVJuhyDo=' 
WHERE 
  key_id = '3af5e5324906249dffd661092735226f1a80cfe9379eee3b91eb0ebdc5ceba00' 
  AND (
    token = 'oHTsnQ1cVWz4842k9fNJ9Tj2CmP7hsHKWaQiVJuhyDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036