UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IUOEVHvZoZnLYz0oBATNde/XuPSqWSjaflyKowZSD0g=' 
WHERE 
  key_id = '2d5ddbc60b2e1d52bc9b0cac2cd6a1f1f2d133d5097df3f941ea5febbce68f21' 
  AND (
    token = 'IUOEVHvZoZnLYz0oBATNde/XuPSqWSjaflyKowZSD0g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031